<div class="layui-side layui-bg-black">
	<div class="layui-side-scroll">
		<#include "/apps/business/workorders/include/left.html">
	</div>
</div>
<div class="layui-body">
	<div class="layui-side-scroll">
		<div class="row">
			<div class="col-lg-12">
				<h1 class="site-h1" style="background-color:#FFFFFF;">
					流程实例列表<#if instanceList??>（${instanceList.totalCount}）</#if>
				</h1>
				<div class="row" style="padding:5px;">
					<div class="col-lg-12">
						<table class="layui-table" lay-skin="line">
						  <colgroup>
								<col width="30%">
								<col width="30%">
								<col width="1%">
								<col width="1%">
								<col width="1%">
								<col width="1%">
								<col width="1%">
								<col>
						  </colgroup>
						  <thead>
								<tr>
									<th>流程名称</th>
									<th>实例编号</th>
									<th nowrap="nowrap">实例启动时间</th>
									<th nowrap="nowrap">实例结束时间</th>
									<th nowrap="nowrap">实例创建人</th>
									<th nowrap="nowrap">状态</th>
									<th nowrap="nowrap">操作</th>
								</tr>
							</thead>
							<tbody>
								<#if instanceList?? && instanceList.result??>
								<#list instanceList.result as instance>
								<tr class="tdHasContorllor">
									<td>								
										<a href="/apps/bpm/display.html?processid=${instance.processId!''}&orderid=${instance.id!''}"><i class="itemicon ds-task"></i>${instance.processName!''}</a>							
									</td>
									<td>${instance.orderNo!''}</td>
									<td nowrap="nowrap">${instance.createTime!''}</td>
									<td nowrap="nowrap">${instance.endTime!''}</td>
									<td nowrap="nowrap">${instance.creator!''}</td>
									<td nowrap="nowrap"><#if instance.orderState == 0>已结束<#else>运行中</#if></td>
									<td nowrap="nowrap">
										<a href="/apps/bpm/display.html?processid=${instance.processId!''}&orderid=${instance.id!''}"><i class="itemicon edit"></i>查看</a>
									</td>	
								</tr>
								</#list>
								</#if>
							</tbody>
						</table>
					</div> 	   
				</div>
				<div class="row" style="padding:5px;">
					<div class="col-lg-12" id="page" style="text-align:center;"></div>
				</div>
			</div>	
		</div>
	</div>
</div>

<script>
	layui.use(['laypage', 'layer'], function(){
		  var laypage = layui.laypage
		  ,layer = layui.layer;
		  
		  laypage.render({
				elem: 'page'
				,pages: <#if instanceList??>${instanceList.totalPages}<#else>0</#if> //总页数
				,curr:<#if instanceList??>${instanceList.number+1}<#else>0</#if>
				,groups: 5 //连续显示分页数
				,jump:function(data , first){
					if(!first){
						location.href = "/apps/bpm/index.html?p="+data.curr ;
					}
				}
		   });
		});
</script>